Encoding refers to converting, according to a standard, a source object to content in another standard format. Decoding is corresponding to encoding and refers to restoring encoded content to original object content by using a same standard that is used during encoding. There are various types of coding and decoding classifications, one of which is systematic code. A feature of the systematic code is that encoded packets output during encoding include all input original packets and may further include multiple other encoded packets. Raptor code is an encoding form of the systematic code, applicable to an erasure channel (Erasure). When encoded packets are being transmitted, some packets may be erased, and during decoding, a complete original packet set needs to be obtained by parsing according to a received non-erased encoded packet.
For example, a Raptor code encoding process is as follows:
A first step of encoding:
Based on
            A      *        ⁢          X      ϖ        =                    A        *            ⁡              [                                                            x                1                                                                        M                                                                          x                k                                                                                        x                                  K                  +                  1                                                                                        M                                                                          x                                  K                  +                  S                                                                                                        x                                  K                  +                  S                  +                  1                                                                                        M                                                                          x                                  K                  +                  S                  +                  H                                                                    ]              =                  [                                            0                                                          M                                                          0                                                                          m                1                                                                        M                                                                          m                K                                                    ]            =              D        ϖ            obtain an intermediate packet set  through calculation according to known A and , where the last K elements of  are original packets.
A second step of encoding:
Based on
                    B        *            ⁢              X        ϖ              =                            [                                                    A                                                                    J                                              ]                *                  [                                                                      x                  1                                                                                    M                                                                                      x                  k                                                                                                      x                                      K                    +                    1                                                                                                      M                                                                                      x                                      K                    +                    S                                                                                                                        x                                      K                    +                    S                    +                    1                                                                                                      M                                                                                      x                                      K                    +                    S                    +                    H                                                                                ]                    =                        [                                                    0                                                                    M                                                                    0                                                                                                          y                    1                                    =                                      m                    1                                                                                                      M                                                                                                          y                    K                                    =                                      m                    K                                                                                                                        y                                      K                    +                    1                                                                                                                        y                                      K                    +                    2                                                                                                      M                                                                                      y                  N                                                              ]                =                              [                                                            0                                                                              M                                                                              0                                                                                                  Y                    ϖ                                                                        ]                    =                      Z            ϖ                                ,obtain all encoded packets  through calculation according to known
  B  =      [                            A                                      J                      ]  and  that is obtained through calculation in the first step of encoding.
Currently, for decoding of systematic code applicable to an erasure channel, an equation indicating a correspondence between an encoded packet and an intermediate packet needs to be first established; after the intermediate packet is obtained by parsing, a matrix multiplication operation is performed on the intermediate packet and a preset matrix to obtain a complete original packet set.
For example, a known algorithm for Raptor code decoding is as follows:
A first step of decoding: Obtain, according to
                    B        *            ⁢              X        ϖ              =                  [                                            0                                                          M                                                          0                                                                          Y                ϖ                                                    ]            =              Z        ϖ              ,an intermediate packet  through calculation by using a received encoded packet  that is not erased and a preset matrix B.
A second step of decoding: Perform matrix multiplication
                    A        *            ⁢              X        ϖ              =                  D        ϖ            =              [                                            0                                                          M                                                          0                                                                          m                1                                                                        M                                                                          m                K                                                    ]              ,and obtain an original packet set
      M    ϖ    =      [                                        m            1                                                            m            2                                                M                                                  m            K                                ]  through calculation according to the known matrix A and  that is obtained in the first step of decoding.
However, in an actual application, when a quantity K of original packets is relatively large, a dimension of a vector indicating an encoded packet set is also quite high. In this case, an intermediate packet is a quite high-dimensional matrix, and an established equation indicating a correspondence between an encoded packet and an intermediate packet is a quite high-dimensional equation. When the quite high-dimensional equation is used to obtain the intermediate packet by parsing, an operation amount is quite large. For example, when K is 1024 and a packet erasure ratio (Erasure Ratio) is 5%, approximately three and a half days are required for decoding for 10,000 times by using a decoding program of Matlab (Matlab) of a common personal computer. In this way, a large amount of time is required for decoding.